Before you look at the summary statistics for opinions on Christians, Atheists, and Muslims you should know what each factor means. The Median is the middle of all the data, it has equal amounts of data less than and greater than. The mean is the average, and the standard deviation is a measure of the dispersion of a set of data from its mean. The more spread apart the data, the higher the deviation.
Summary statistics for Christians:
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
0.00 40.00 50.00 49.74 70.00 100.00 281
standard deviation: 20.29
Summary statistics for Atheists:
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
0.00 40.00 50.00 49.74 70.00 100.00 281
standard deviation: 26.27
Box plot for Christians:
In this box plot it shows that the opinion of Christians in the United States is very high. Even though the US doesnt identify with any religion Christian is the most favorable religion.
Box plot for Atheists:
Compared to the Christian box plot above, the US does not favor Atheism. The same goes for the Muslim box plot below.
Box plot for Muslims:violin plots:
This violin plot is another great way of showing just how high the opinions on Christians in the US is. It is a combination of a box plot and kernal density plot. In the green Christian plot you can see that most opinions of Christians are high. If you scroll down the Atheist violin plot it looks a lot different.
Back to back histogram:
A back to back histogram shows both histograms of the Christian/Atheist data back to back. With this plot you can see much easier exactly how favorable the Christian religion is compared to Atheism in the US.
scatter plot:
In this scatter plot you can see that the more someone like christianity, the less they like atheism.
density plot:
Summary statistics for Christians:
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
0.00 40.00 50.00 49.74 70.00 100.00 281
standard deviation: 20.29
Summary statistics for Atheists:
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
0.00 40.00 50.00 49.74 70.00 100.00 281
standard deviation: 26.27
Box plot for Christians:
In this box plot it shows that the opinion of Christians in the United States is very high. Even though the US doesnt identify with any religion Christian is the most favorable religion.
Box plot for Atheists:
Compared to the Christian box plot above, the US does not favor Atheism. The same goes for the Muslim box plot below.
Box plot for Muslims:violin plots:
This violin plot is another great way of showing just how high the opinions on Christians in the US is. It is a combination of a box plot and kernal density plot. In the green Christian plot you can see that most opinions of Christians are high. If you scroll down the Atheist violin plot it looks a lot different.
Back to back histogram:
A back to back histogram shows both histograms of the Christian/Atheist data back to back. With this plot you can see much easier exactly how favorable the Christian religion is compared to Atheism in the US.
scatter plot:
In this scatter plot you can see that the more someone like christianity, the less they like atheism.
density plot:
R Script:
install.packages("foreign")
library(foreign)
fix(nes)
ls(nes)
summary(nes$christians)
summary(nes$atheists)
summary(nes$muslims)
sd(nes$christians, na.rm=TRUE)
sd(nes$atheists, na.rm=TRUE)
sd(nes$muslims, na.rm=TRUE)
dev.off()
boxplot(nes$christians, col="green")
boxplot(nes$atheists, col="red")
boxplot(nes$muslims, col="blue")
install.packages("wvioplot")
library(wvioplot)
wvioplot(nes$christians, col="green", names="Christians")
wvioplot(nes$atheists, col="red", names="Atheists")
wvioplot(nes$muslims, col="blue", names="Muslims")
histbackback(nes$christians, nes$atheists, probability=TRUE, main="back to back histogram")
install.packages("car")
library("car")
scatterplot(nes$christians, nes$atheists)
plot(density(nes$christians, na.rm=TRUE))
hist(nes$christians)
hist(nes$atheists)
Excellent job, except that you forgot to calculate and explain the correlation coefficient!